import React, { Component } from 'react'
import dva, { connect, Provider } from 'dva'

const app = dva()


app.model({
  namespace: 'jobListBackEnd',
  state: [],
  reducers: {
    update(state, action) { 
      const { payload } = action
      return payload
     },
    // minus(count) { return count - 1 },
  },
});


class TestDva extends Component {
    constructor(props) {
        super(props);
        this.state = {
        };
    }

    componentDidMount() {
    }

    componentDidUpdate(prevProps, prevState) {
        if (prevProps.someProp!== this.props.someProp) {
            console.log('Some prop has changed');
        }
    }

    componentWillUnmount() {
        // 在此处添加组件卸载前执行的逻辑，例如清除定时器等
        console.log('Component TestDva is about to be unmounted');
    }


    render() {
        return (
            <Provider>
                <button onClick={this.handleClick}>点击增加</button>
            </Provider>
        );
    }
}

export default connect()(TestDva);